import request from '@/utils/request'

//获得父类
export function getParent() {
  return request({
    url: '/storage/goods/getParent',
    method: 'get'
  })
}
//获得小类
export function getChild(query) {
  return request({
    url: '/storage/goods/getChild',
    method: 'post',
    data: query
  })
}
//获得小类数量
export function getTotal(query) {
  return request({
    url: '/storage/goods/getTotal',
    method: 'post',
    data: query
  })
}
//查询所有存储类别
export function getAllType(query) {
  return request({
    url: '/storage/storagePrice/getAll',
    method: 'post',
    data: query
  })
}
export function addGoods2(data) {
  return request({
    url: '/storage/goods/addGoods2',
    method: 'post',
    data: data
  })
}
//新增
export function addGoods(data) {
  return request({
    url: '/storage/goods/addGoods',
    method: 'post',
    data: data
  })
}
//查找一个
export function getGoodsById(goodsId) {
  return request({
    url: '/storage/goods/'+goodsId,
    method: 'get'
  })
}
//修改
export function updateGoods(data) {
  return request({
    url: '/storage/goods/updateGoods',
    method: 'post',
    data: data
  })
}
export function deleteGoods(goodIds) {
  return request({
    url: '/storage/goods/'+goodIds,
    method: 'post',
  })
}
export function delGoods(goodIds) {
  return request({
    url: '/storage/goods/del/'+goodIds,
    method: 'get',
  })
}
// 查询岗位列表
export function listPost(query) {
  return request({
    url: '/system/post/list',
    method: 'get',
    params: query
  })
}

// 查询岗位详细
export function getPost(postId) {
  return request({
    url: '/system/post/' + postId,
    method: 'get'
  })
}

// 新增岗位
export function addPost(data) {
  return request({
    url: '/system/post',
    method: 'post',
    data: data
  })
}

// 修改岗位
export function updatePost(data) {
  return request({
    url: '/system/post',
    method: 'put',
    data: data
  })
}

// 删除岗位
export function delPost(postId) {
  return request({
    url: '/system/post/' + postId,
    method: 'delete'
  })
}
